from tinyshop.common.setup_bg import setup_wd
from tinyshop.common.goods_order import goods_order
class Goods_case:
    def check_deliver_goods(self,li,expect):
        s = setup_wd()
        t = goods_order(s.wd)
        t.goods(li[0],li[8])
        op = open(r'C:\Users\Administrator\Desktop\caseall\log.txt','a+')
        try:
            re = s.wd.find_element_by_xpath('/html/body/div[3]/div[2]/form/table/tbody/tr[2]/td[10]/span').text
            if re == '已发货':
                print(expect)
                op.write('%s\n测试结果通过\n\n'%(li))

        except:
            print(expect)
            op.write('%s\n测试结果未通过\n\n'%(li))